-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ref(sdk/go): Refactor the Redis Go SDK to be more idiomatic #1844
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A reminder to track or line up updates to examples/docs in https://github.com/fermyon/developer on/around the 2.0 release.
Not sure if we have opinionated Go programmers/users that might be a better sign-off on this PR, but the changes look reasonable to me!
aee1fd9
to
006792f
Compare
bb5f39c
to
9b57763
Compare
// should work with any Redis command. | ||
// | ||
// Arguments must be string, []byte, int, int64, or int32. | ||
func (c *Client) Execute(command string, arguments ...any) ([]*Result, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would love some opinions on using an any
rather than a typed argument. I don't know how I feel about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its pretty standard for better or worse 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would probably have this return an error if an unsupported type is passed in though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added an error
d2322cb
to
39b0699
Compare
- Introduces a client struct responsible for handling the connection - Refactor the `Execute()` arguments Signed-off-by: Adam Reese <[email protected]>
39b0699
to
ae26b6e
Compare
Execute()
arguments